package com.treeroot.addservice.address.controller;

import com.treeroot.addservice.address.service.PcAdProvinceService;
import com.treeroot.commonutils.result.R;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Description:
 * @Author:treeRoot
 * @Email:553503639@qq.com
 * @Date: Create in 00:17 / 2022/5/13
 */

//TODO：地址管理模块移植公共模块

@RestController
@Api(description = "省市区资源")
@RequestMapping("/address")
public class AddressController {
    @Autowired
    private PcAdProvinceService provinceService;

    /**
     * 查出子分类，组装起来
     * @param provinceCode  省份code
     * @param cityCode      市code
     */
    @GetMapping("/list/tree/{provinceCode}/{cityCode}")
    public R list( String provinceCode,  String cityCode) {
        Map map =provinceService.getAddress(provinceCode,cityCode);
        return R.ok().data(map);
    }




}
